#ifndef _REVERSI_CPLAYER_H_
#define _REVERSI_CPLAYER_H_

#include "cdeadline.h"
#include "cmove.h"
#include "cboard.h"
#include <vector>
#include <climits>

namespace reversi {

class CPlayer
{
public:
    ///constructor
    
    ///Shouldn't do much. Any expensive initialization should be in 
    ///Initialize
    CPlayer();

    ///perform initialization of the player
    
    ///\param pFirst true if we will move first, false otherwise
    ///\param pDue time before which we must have returned. To check how
    ///much time we have left you can use \p pDue.TimeUntil(), which returns
    ///the remaining time in milliseconds.
    ///That's the only safe way to use the pDue parameter.
    void Initialize(bool pFirst,const CDeadline &pDue);

    ///perform a move

    ///\param pBoard the current state of the board
    ///\param pDue time before which we must have returned. To check how
    ///much time we have left you can use \p pDue.TimeUntil(), which returns
    ///the remaining time in milliseconds.
    ///That's the only safe way to use the pDue parameter.
    ///\return the move we make
    CMove Play(const CBoard &pBoard,const CDeadline &pDue);

private:
    //Adjustable parameters
    int ownSideValue;
    int otherSideValue;
    int cornerValue;
    int initDepth;
    int maxDepth;
    int winningBoard;
    int losingBoard;
    int ownLeft;
    int otherLeft;
    CDeadline tLeft;
    //Method that returns the move that will be made by the player
    CMove minmax(CBoard b, int depth);

    //Method that performs the selection of the most adequate play for OWN
    int maximize(CBoard b, int depth, int alpha, int beta, bool isPass);

    //Method that performs the selection of the most adequate play for OTHER
    int minimize(CBoard b, int depth, int alpha, int beta, bool isPass);

    //Method that returns the value of a given board
    int boardEval(CBoard b);

};

/*namespace reversi*/ }

#endif
